package com.ozo.cloud.auth.feign;

import com.ozo.cloud.api.auth.feign.AuthFeignClient;
import com.ozo.cloud.common.base.model.LoginUser;
import com.ozo.cloud.common.base.model.ResultVO;
import com.ozo.cloud.common.satoken.context.UserLoginHelper;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RestController;

/**
 * 授权服务调用
 *
 * @author qiangesoft
 * @date 2024-09-11
 */
@RequiredArgsConstructor
@RestController
public class AuthFeignController implements AuthFeignClient {

    @Override
    public ResultVO<LoginUser> checkToken(String token) {
        LoginUser loginUser = UserLoginHelper.getLoginUserByToken(token);
        return ResultVO.success(loginUser);
    }

}
